package org.ym.tools.adapter;

import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;

/**
 * 反序列化规则设置
 * @author ym
 */
public class DeserializationExclusionStrategyImpl implements ExclusionStrategy {
    @Override
    public boolean shouldSkipField(FieldAttributes fieldAttributes) {
        IgnoreField ignoreField = fieldAttributes.getAnnotation(IgnoreField.class);
        if(ignoreField != null){
            return ignoreField.ignoreDeserialize();
        }
        return false;
    }

    @Override
    public boolean shouldSkipClass(Class<?> aClass) {
        return false;
    }
}
